﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using FDSimpleModelGenerator.Common.Enums;
using FDSimpleModelGenerator.Entities;
using FDSimpleModelGenerator.Entities.Enums;

namespace FDSimpleModelGenerator.IServices
{
    /// <summary>
    /// 模型代码生成引擎
    /// </summary>
    public interface IModelGenerateEngine
    {
        /// <summary>
        /// 获取语言数据类型映射服务
        /// </summary>
        /// <param name="languageDataType"></param>
        /// <returns></returns>
        IDataTypeMapperService GeTypeMapperService(LanguageDataType languageDataType);

        /// <summary>
        /// 生成模型
        /// </summary>
        /// <param name="tableInfo">表信息</param>
        /// <param name="templateContent">模板内容</param>
        /// <param name="namespaceName">命名空间</param>
        /// <param name="propertyFirstCharLower">属性首字母小写</param>
        /// <param name="languageDataType">语言数据类型</param>
        /// <returns></returns>
        string Generate(TableInfo tableInfo, string templateContent, string namespaceName, LanguageDataType languageDataType, bool propertyFirstCharLower = false);

        /// <summary>
        /// 生成模型
        /// </summary>
        /// <param name="tableInfo">表信息</param>
        /// <param name="templateContent">模板内容</param>
        /// <param name="namespaceName">命名空间</param>
        /// <param name="propertyFirstCharLower">属性首字母小写</param>
        /// <param name="languageDataType">语言数据类型</param>
        /// <returns></returns>
        Task<string> GenerateAsync(TableInfo tableInfo, string templateContent, string namespaceName, LanguageDataType languageDataType, bool propertyFirstCharLower = false);
    }
}
